package com.pacai.varscope;

public class VarScope {
    public static void main(String[] args) {
        Cat cat = new Cat();
        cat.hi();
        cat.cry();
        cat.eat();
    }
}


class Cat{
    int age = 10;
    double weight;
    {
      int n = 90;
      age = n;
    }
    public void hi(){
        int num = 1;
        String address = "北京的猫";
        System.out.println("num = " + num);
        System.out.println("address = " + address);
        System.out.println("age = " + age);
    }
    public void cry(){
        int n = 1;
        String name = "jack";
        System.out.println("name = " + name + this.age + " " + age);

    }

    public void eat(){
        System.out.println(age);
        //System.out.println(name); err
    }
}